﻿using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using MaxAlarm.Common.WebQueries;

namespace MaxAlarm.Core.WebQueries
{
    public class WebGetQuery : WebQuery
    {
        public override WebQueryType QueryType
        {
            get { return WebQueryType.GET; }
        }

        public WebGetQuery(string address, string cookieContainer, NameValueCollection data) 
            : base(address, cookieContainer, data)
        {
        }

        protected override string SendData(WebClient client, string url, NameValueCollection data)
        {
            var address = string.Format("{0}{1}", url, ToQueryString(data));
            return client.DownloadString(address);
        }
    }
}
